<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>
    <!DOCTYPE html>
<html lang="en" class="app">
	<head>
		<meta charset="utf-8" />
		<link rel="stylesheet" href="<c:url value='/css/app.v2.css'></c:url>" type="text/css" />
</head>
<body>
						<section class="vbox">
							<section class="scrollable padder">
								<ul class="breadcrumb no-border no-radius b-b b-light pull-in">
									<li>
										<a href="index.html"><i class="fa fa-home"></i> 主页</a>
									</li>
									<li class="active">论坛管理</li>
									<li class="active">主题信息管理</li>
								</ul>
								<div class="m-b-md">
									<h3 class="m-b-none">主题列表</h3>
								</div>

								<!--表单一 -->
								
								<section class="panel panel-default">
									<header class="panel-heading">主题列表</header>
									<div class="table-responsive">
										<table id="MyStretchGrid" class="table table-striped datagrid m-b-sm">
											<thead>
												<tr>
													<th>序号</th>
													<th>ID</th>
													<th>主题名称</th>
													<th>发布时间</th>
													<th>作者</th>
													<th>话题名称</th>
													<th>类型</th>
													<th>回复数</th>
													<th>最后更新时间</th>
													<th>置顶</th>
													<th>精华</th>
													<th>普通</th>
													<th>删除</th>
												</tr>
											</thead>
											<tbody class="formtable">
											<c:forEach items="${topicList}" var="topic" varStatus="status">
												<tr>
													<td>${status.index +1 }</td>
													<td>${topic.id }</td>
													<td><a href="<c:url value='/reply/getReplyList?pageId=1&topicid=${topic.id}'></c:url>">${topic.title }</a></td>
													<td>${topic.posttime }</td>
													<td>${topic.name }</td>
													<td>${topic.forumname }</td>
													<td>
													<c:if test="${topic.type == 0}">
														置顶主题
													</c:if>
													<c:if test="${topic.type == 1}">
														精华主题
													</c:if>
													<c:if test="${topic.type == 2}">
														普通主题
													</c:if>
													</td>
													<td>${topic.replycount }</td>
													<td>${topic.lastupdatetime}</td>
													<td><button type="button" class="am-btn am-btn-primary" onclick="changType(${topic.id},0)">置顶</button></td>
													<td><button type="button" class="am-btn am-btn-primary" onclick="changType(${topic.id},1)">精华</button></td>
													<td><button type="button" class="am-btn am-btn-primary" onclick="changType(${topic.id},2)">普通</button></td>
													<td>
														<a type="button" onclick="sureDeleteTopic(${topic.id});">
															<i class="fa fa-trash-o"></i>
														</a>
													</td>
												</tr>
											</c:forEach>
											</tbody>
										</table>
										<nav class="pull-right">
										  <ul class="pagination ">
										  <c:if test="${topicVO.forumid != null}">
										  	<li><a href="<c:url value='/topic/getTopicList?pageId=1&forumid=${topicVO.forumid }'></c:url>">首页</a></li>
										    <c:if test="${topicVO.currentPage > 1}">
										    	<li><a href="<c:url value='/topic/getTopicList?pageId=${topicVO.currentPage -1}&forumid=${topicVO.forumid }'></c:url>">上一页</a></li>
										    </c:if>
											<li><a href='<c:url value='/topic/getTopicList?pageId=${topicVO.currentPage}&forumid=${topicVO.forumid }'></c:url>'>${topicVO.currentPage }</a></li>
										    <c:if test="${topicVO.currentPage < topicVO.totalPage}">
										    	<li><a href="<c:url value='/topic/getTopicList?pageId=${topicVO.currentPage +1}&forumid=${topicVO.forumid }'></c:url>">下一页</a></li>
										    </c:if>
										    <li><a href="<c:url value='/topic/getTopicList?pageId=${topicVO.totalPage}&forumid=${topicVO.forumid }'></c:url>">尾页</a></li>
										     
										    <li>总页数：${topicVO.totalPage}</li>
										    <li>总记录数：${topicVO.totalCount}</li>
										  </c:if>
										  <c:if test="${topicVO.forumid == null }">
										  	<li><a href="<c:url value='/topic/getTopicList?pageId=1'></c:url>">首页</a></li>
										    <c:if test="${topicVO.currentPage > 1}">
										    	<li><a href="<c:url value='/topic/getTopicList?pageId=${topicVO.currentPage -1}'></c:url>">上一页</a></li>
										    </c:if>
											<li><a href='<c:url value='/topic/getTopicList?pageId=${topicVO.currentPage}'></c:url>'>${topicVO.currentPage }</a></li>
										    <c:if test="${topicVO.currentPage < topicVO.totalPage}">
										    	<li><a href="<c:url value='/topic/getTopicList?pageId=${topicVO.currentPage +1}'></c:url>">下一页</a></li>
										    </c:if>
										    <li><a href="<c:url value='/topic/getTopicList?pageId=${topicVO.totalPage}'></c:url>">尾页</a></li>
										     
										    <li>总页数：${topicVO.totalPage}</li>
										    <li>总记录数：${topicVO.totalCount}</li>
										  </c:if>
										  </ul>
										</nav>
									</div>
								</section>

							</section>
						</section>
						<a href="#" class="hide nav-off-screen-block" data-toggle="class:nav-off-screen" data-target="#nav"></a>
					</section>
					<aside class="bg-light lter b-l aside-md hide" id="notes">
						<div class="wrapper">Notification</div>
					</aside>
				</section>
			</section>

		
		<script src="<c:url value='/js/jquery-3.1.0.min.js'></c:url>"></script>
		<script src="<c:url value='/js/app.v2.js'></c:url>"></script>
		<script src="<c:url value='/js/layer.js'></c:url>"></script>
		<script src="<c:url value='/js/topiclist.js'></c:url>"></script>
</body>
</html>